﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace _11_TimerCallBack
{
    class Program
    {
        static void Writer(object obj)
        {
            Console.Clear();
            Console.WriteLine(obj +  "; " + DateTime.Now.ToLongTimeString());
        }

        static void Main(string[] args)
        {
            //TimerCallback tm = Writer;
            Timer timer = new Timer(Writer, "State", 5000, 1000);
            //while (true)
            //{
            //    Console.WriteLine("Main");
            //    Thread.Sleep(500);
            //}
            //Console.ReadLine();
            Thread.CurrentThread.Join();
        }
    }
}
